//
//  LeftCommonCell.m
//  Flava
//
//  Created by Ug-Code on 13-8-14.
//  Copyright (c) 2013年 UgCode. All rights reserved.
//

#import "LeftCommonCell.h"

@implementation LeftCommonCell

- (id)initWithStyle:(UGTableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
		//-- 初始化Button
        _rootBurron = [[UGButton alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
		//-- 判断并添加背景色
		if (style == UGTableViewCellStyle1) {
			[_rootBurron setNormalImageWithFile:@"cell_bg_common2_n.png"];
			[_rootBurron setHighlightedImageWithFile:@"cell_bg_common2_h.png"];
		} else if (style == UGTableViewCellStyle2) {
			[_rootBurron setNormalImageWithFile:@"cell_bg_common3_n.png"];
			[_rootBurron setHighlightedImageWithFile:@"cell_bg_common3_h.png"];
		}
		//--初始化箭头
		UIImageView *arrowImageView =
			[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow2.png"]];
		arrowImageView.frame = CGRectMake(240, 15, 15, 20);
		//-- 初始化lable
		_titleLable = [[UILabel alloc] initWithFrame:CGRectMake(10, 19, 185, 13)];
		_titleLable.backgroundColor = UGAlphaColor;
		_titleLable.font = [UIFont systemFontOfSize:13];
		_titleLable.textColor = [UIColor grayColor];
		//-- 添加视图
		[self.contentView addSubview:_rootBurron];
		[self.contentView addSubview:arrowImageView];
		[self.contentView addSubview:_titleLable];
		
    }
    return self;
}

- (void)setTableCellModel:(LeftTableCellModel *)model
{
	_titleLable.text = model.titleText;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
